---@module ccpm的orm数据结构

local _ccpm = class('ModelCcpm', require('framework.orm.base'))
--======================================
--default params
local d = Ding
local Logger = d.Logger
local UtilRds = d.UtilRds
local uuid = d.uuid
--======================================

-- local CCPM_KEYS = {
--     "pluginid",
--     "name",
--     "ver",
--     "desc",
--     "entry",
--     "license",
--     "dependencies",
--     "contsize",
--     "uploadtime",
--     "gitee_user",
--     "static_type",
--     "ptype"
-- }

function _ccpm:ctor(cfg)
    self.super.ctor(self, cfg)
end

function _ccpm:new_model(cfg)
    return cfg
end

function _ccpm:group_name_by_limitcond(condic, minidx, maxidx)
    if self._dccfg['ctype'] ~= 'mysql' then
        return
    end
    Logger:info('tbname is %s--->>', self:cfg_tbname())
    local cmd = UtilRds.find(self:cfg_tbname(), condic)
    cmd = UtilRds.append_cmd(cmd, 'group', {'name'})
    cmd = UtilRds.append_cmd(cmd, 'limit', minidx, maxidx)
    return self:_dc():query_cmd(cmd)
end

return _ccpm
